package chloroform.util

import argo.jdom.JdomParser
import java.io.PrintWriter
import javax.servlet.http.HttpServletResponse
import chloroform.Renderer

/**
 * Created by IntelliJ IDEA.
 * User: zslajchrt
 * Date: 7.3.11
 * Time: 16:57
 * To change this template use File | Settings | File Templates.
 */

object JsonUtils {
  val parser = new JdomParser()

  def renderResponse(resp: HttpServletResponse, renderer: Renderer): Unit = {
    resp.setContentType("application/json")
    resp.setCharacterEncoding("utf-8")
    val printWriter: PrintWriter = resp.getWriter
    renderer.render(printWriter)
  }

}